package com.wms.common;

import com.baomidou.mybatisplus.extension.api.R;
import lombok.Data;

import static javax.swing.text.html.HTML.Tag.OL;

@Data
public class Result {
    private  int code;//编码 200 //400
    private String message;//成功//失败
    private  Long total; //总记录数
    private  Object data; //数据

   public static Result fail(){
        return result(400,"失败",0L,null);
    }
    public static Result suc(){
        return result(200,"成功",0L,null);
    }
    public static Result suc(Object data,Long total){
        return result(200,"成功",total,data);
    }

    private static  Result result(int code,String message,Long total,Object data){
        Result res = new Result();
        res.setData(data);
        res.setMessage(message);
        res.setCode(code);
        res.setTotal(total);
        return res;
    }

}
